<?php
/*
 * Created by generator
 *
 */

class Editsaison extends Controller {

	function Editsaison(){
		parent::Controller();
		$this->load->model('saison_model');
		$this->load->library('session');
		$this->load->helper('url');
	}


	/**
	 * Affichage des infos
	 */
	public function index($saiidsai){
		$model = saison_model::getsaison($this->db, $saiidsai);
		$data['saison'] = $model;

		$this->load->view('editsaison_view',$data);
	}

	/**
	 * Sauvegarde des modifications
	 */
	public function save(){
		// Mise a jour des donnees en base
		$model = new saison_model();
		$model->saiidsai = $this->input->post('saiidsai');
		$model->sailbnom = $this->input->post('sailbnom'); 
		$model->saidtdeb = $this->input->post('saidtdeb'); 
		$model->saidtfin = $this->input->post('saidtfin'); 
		$model->sainbsem = $this->input->post('sainbsem');
		$model->update($this->db);

		$this->session->set_flashdata('message', 'Saison mise a jour');

		redirect('listsaisons/index'); 
	}
	
}
?>
